$(function() {

   if(!window.ActiveXObject){
        $("#footht").css("height","20px");
        $(".signshow").css("padding-left","10px");
    }else{
        $(".signshow").css("padding-left","20px");
    }
    initZYbg();
   initData();
   $(window).resize(function() {
			    initZYbg();
			   });
	    });
function initZYbg(){ 
 if(document.body.clientWidth<957){
	        $("#mainleft").width(0);
	        $("#mainright").width(0);
	        $("#mainleft").css("display","none");
		    $("#mainright").css("display","none");
		    $("#pager").css("left","0px");
        }else{
	       if(!window.ActiveXObject){
		        var wid=($(document).width()-953)/2;
		        $("#mainleft").width(wid);
		        $("#mainright").width(wid);
		        $("#mainleft").css("display","block");
		        $("#mainright").css("display","block");
		         $("#pager").css("left",wid+"px");
		    }else{
		        var wid=($(document).width()-974)/2;
		        if(wid>0){
		        	$("#mainleft").width(wid);
			        $("#mainright").width(wid);
			        $("#mainleft").css("display","block");
			        $("#mainright").css("display","block");
			        $("#pager").css("left",wid+"px");
		        }
		    }
        }
}
function initData(){
	$("#zslist").html("");
	if(cid>0){
		IndexDwr.getListBySize(currentpage,cid,"",15,function(data){
			currentpage=data.pageNo;
			totalpage=data.totalPages==0?1:data.totalPages;
			var trs="";
			for(var i=0;i<data.knows.length;i++){
				   trs=trs+template.replace("#Title#",data.knows[i].title)
				                  .replace("#ID#",data.knows[i].id);
				   if(data.knows[i].type>0){
					   trs=trs.replace("#IMG#", '<a href="download.do?id='+data.knows[i].id+'" target="_blank"><img alt="" style="border:0px;" src="img/gl/format/'+data.knows[i].type+'.gif"/></a>')
				   }else{
					   trs=trs.replace("#IMG#","");
				   }
			   }
			$("#zslist").append(trs);
			$("#pager").css("display","");
			createPager(totalpage,currentpage,"pager",5);
		});
	}
	
}
function ChangePage(num){
	currentpage=num;
	initData();
}
var template='<tr>'+
    '<td class="dot"></td>'+
    '<td class="ztitle">'+
    '   <span class="ztle"> <a href="zsdetail.do?id=#ID#" target="_blank">#Title#</a></span>'+
    '   #IMG#'+
    ' </td>'+
    '</tr>';